package beans;

import com.google.gson.Gson;

public class UserStoryBean {
	private int id;
	private int projectId;
	private String projectName;
	private String name;
	private String description;
	private int type;
	private String typeName;
	private Integer storyPoints;	// allow for null

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getProjectId() {
		return projectId;
	}

	public void setProjectId(int projectId) {
		this.projectId = projectId;
	}

	public String getProjectName() {
		return projectName;
	}
	
	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}

	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	public String getDescription() {
		return description;
	}
	
	public void setDescription(String description) {
		this.description = description;
	}
	
	public int getType() {
		return type;
	}
	
	public void setType(int type) {
		this.type = type;
	}
	
	public String getTypeName() {
		return typeName;
	}

	public void setTypeName(String typeName) {
		this.typeName = typeName;
	}

	public Integer getStoryPoints() {
		return storyPoints;
	}
	
	public void setStoryPoints(Integer storyPoints) {
		this.storyPoints = storyPoints;
	}

	public String getJson() {
		StringBuffer sb = new StringBuffer();
		Gson gson = new Gson();
		
		sb.append("{");
		sb.append("\"user_story_id\": " + gson.toJson(id) + ",");
		sb.append("\"user_story_project_id\": " + gson.toJson(projectId) + ",");
		sb.append("\"user_story_project_name\": " + gson.toJson(projectName) + ",");
		sb.append("\"user_story_name\": " + gson.toJson(name) + ",");
		sb.append("\"user_story_description\": " + gson.toJson(description) + ",");
		sb.append("\"user_story_type\": " + gson.toJson(type) + ",");
		sb.append("\"user_story_type_name\": " + gson.toJson(typeName) + ",");
		sb.append("\"user_story_story_points\": " + gson.toJson(storyPoints));
		sb.append("}");

		return sb.toString();
	}
}
